/**
 * Created with Vim7.3 ubuntu12.04
 * @fileOverview : 
 * @author : Lyle <lylechen2014@gmial.com>
 * @since : 2015-03-03 21:51:05
 * @filename : controller/user.js
 * @version : 
 * @description : 
 */

define(function(require, exports, module){
    var tplUser = require('{view}user.tpl');

    var UserView = Backbone.View.extend({
    
        el: 'body',

        initialize: function (obj) { 
            this.run(obj);
        }, 

        run: function (obj) {
            this.tplRender();
        },

        tplRender : function() {           
            if ($('#user').length < 1) { 
                $('body').append(_.template(tplUser)());
                this.bindEvt();
            } else {
                $('#user').css('display','block');
            }          
        },
 
        bindEvt : function() {
            $('#user').find('.prev').on('tap',function(){
                 Backbone.routerObj.navigate('index/left', { trigger: true });return;
            });
            
            $('#user').find('.next').on('tap',function(){
                 Backbone.routerObj.navigate('index/left', { trigger: true });return;
            }); 
        },
   
	});

	module.exports = UserView;
})

